package gov.pbc.nn.kjgl.software.view;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import gov.pbc.nn.kjgl.entity.DeclareTime;
import gov.pbc.nn.kjgl.software.dao.DeclareTimeDao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.provider.Page;

@Component("declareTimePR")
public class DeclareTimePR {

	@Autowired
	private DeclareTimeDao declareTimeDao;

	/**
	 * 获取集中申报期限
	 * 
	 * @param page
	 */
	@DataProvider
	public void loadDeclareTime(Page<DeclareTime> page) {
		declareTimeDao.loadDeclareTime(page);
	}

	/**
	 * 维护集中申报期限
	 * 
	 * @param declareTime
	 * @param parameter
	 */
	@Transactional
	@DataResolver
	public void saveDeclareTime(Collection<DeclareTime> declareTime,
			Map<String, Object> parameter) {
		declareTimeDao.saveDeclareTime(declareTime, parameter);
	}

	/**
	 * 删除集中申报期限
	 * 
	 * @param list
	 */
	@Transactional
	@Expose
	public void deleteDeclareTime(List<String> list) {
		declareTimeDao.deleteDeclareTime(list);
	}
}
